package com.nuoniu.sibanyun.service.production.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nuoniu.sibanyun.entity.production.ErpBomDetail;
import com.nuoniu.sibanyun.entity.vo.ErpBomDetailVo;
import com.nuoniu.sibanyun.mapper.production.VBomDetailMapper;
import com.nuoniu.sibanyun.service.production.IVBomDetailService;
import com.nuoniu.sibanyun.userThread.UserInfo;
import com.nuoniu.sibanyun.userThread.UserThreadLocal;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * bom明细表 服务实现类
 * </p>
 *
 * @author 小啊刚
 * @since 2021-01-08
 */
@Service
public class VBomDetailServiceImpl extends ServiceImpl<VBomDetailMapper, ErpBomDetail> implements IVBomDetailService {

    @Override
    public List<ErpBomDetail> getByBomId(Long bomId) {
        return baseMapper.getByBomId(bomId);
    }

    @Override
    public List<ErpBomDetailVo> listErpBomDetailVo(Long parentBomId) {
        UserInfo userInfo = UserThreadLocal.get();
        return baseMapper.listErpBomDetailVo(parentBomId,userInfo.getCompanyId());
    }
}
